package com.logistics.system.service.impl;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.logistics.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.logistics.system.mapper.BankCardMapper;
import com.logistics.system.domain.BankCard;
import com.logistics.system.service.IBankCardService;

/**
 * 通知公告Service业务层处理
 * 
 * @author logistics
 * @date 2024-06-25
 */
@Service
public class BankCardServiceImpl implements IBankCardService 
{
    @Autowired
    private BankCardMapper bankCardMapper;

    /**
     * 查询通知公告
     * 
     * @param cardId 通知公告主键
     * @return 通知公告
     */
    @Override
    public BankCard selectBankCardByCardId(Long cardId)
    {
        return bankCardMapper.selectBankCardByCardId(cardId);
    }

    /**
     * 查询通知公告列表
     * 
     * @param bankCard 通知公告
     * @return 通知公告
     */
    @Override
    public List<BankCard> selectBankCardList(BankCard bankCard)
    {
        return bankCardMapper.selectBankCardList(bankCard);
    }

    /**
     * 新增通知公告
     * 
     * @param bankCard 通知公告
     * @return 结果
     */
    @Override
    public int insertBankCard(BankCard bankCard)
    {
        bankCard.setCreateTime(DateUtils.getNowDate());
        return bankCardMapper.insertBankCard(bankCard);
    }

    /**
     * 修改通知公告
     * 
     * @param bankCard 通知公告
     * @return 结果
     */
    @Override
    public int updateBankCard(BankCard bankCard)
    {
        bankCard.setUpdateTime(DateUtils.getNowDate());
        return bankCardMapper.updateBankCard(bankCard);
    }

    /**
     * 批量删除通知公告
     * 
     * @param cardIds 需要删除的通知公告主键
     * @return 结果
     */
    @Override
    public int deleteBankCardByCardIds(Long[] cardIds)
    {
        return bankCardMapper.deleteBankCardByCardIds(cardIds);
    }

    /**
     * 删除通知公告信息
     * 
     * @param cardId 通知公告主键
     * @return 结果
     */
    @Override
    public int deleteBankCardByCardId(Long cardId)
    {
        return bankCardMapper.deleteBankCardByCardId(cardId);
    }

//    @Override
//    public void updateBankPriceBypayer(Long payerId, BigDecimal payerBalance) {
//
//        bankCardMapper.updateBankPriceBypayer(payerId,payerBalance);
//    }
//
//    @Override
//    public void updateBankPriceBypayee(Long payeeId, BigDecimal payeeBalance) {
//        bankCardMapper.updateBankPriceBypayee(payeeId,payeeBalance);
//    }

    @Override
    public BankCard selectBankCardByUserId(Long payerId) {
        return bankCardMapper.selectBankCardByUserId(payerId);
    }
}
